<html>
	<head>
		<meta charset="utf-8"></meta>
		<title>BMainWindow</title>
		<link href="./style.css" rel="stylesheet" type="text/css"/>
	</head>
	<body>
		<div class="class" name="BMainWindow">
			<h1>BMainWindow</h1>
			<p>继承自<a href="BWidget.html">BWidget</a></p>
			<p id="resume">BMainWindow是显示标题的主窗口控件，其会在初始显示时以合适的大小显示于屏幕中央。<a href="#desc">详细</a></p>
			<h2>public</h2>
			<table id="public">
				<tr><td align="right"></td><td><a href="#BMainWindow(BWidget*)">BMainWindow</a>(BWidget* parent = 0);</td></tr>
				<tr><td align="right"></td><td><a href="#BMainWindow(const BString&,BWidget*)">BMainWindow</a>(const BString& title, BWidget* parent = 0);</td></tr>
				<tr><td align="right"></td><td><a href="#~BMainWindow()">~BMainWindow</a>();</td></tr>
				<tr><td align="right">virtual bool </td><td><a href="#setTitle(const BString&)">setTitle</a>(const BString& title);</td></tr>
				<tr><td align="right">virtual bool </td><td><a href="#setIcon(BIcon*)">setIcon</a>(BIcon* icon);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#setFrameless(bool)">setFrameless</a>(bool frameless);</td></tr>
				<tr><td align="right">void </td><td><a href="#setTitleVisible(bool)">setTitleVisible</a>(bool titleVisible);</td></tr>
				<tr><td align="right">bool </td><td><a href="#titleVisible()">titleVisible</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#setTitleAlign(Align)">setTitleAlign</a>(Align titleAlign);</td></tr>
				<tr><td align="right">Align </td><td><a href="#titleAlign()">titleAlign</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#setTitleForm(Form)">setTitleForm</a>(Form titleForm);</td></tr>
				<tr><td align="right">Form </td><td><a href="#titleForm()">titleForm</a>() const;</td></tr>
				<tr><td align="right">BButton* </td><td><a href="#addTitleButton(Button)">addTitleButton</a>(Button button = Button_None);</td></tr>
				<tr><td align="right">bool </td><td><a href="#addTitleButton(BButton*)">addTitleButton</a>(BButton* button);</td></tr>
				<tr><td align="right">BButton* </td><td><a href="#insertTitleButton(int,Button)">insertTitleButton</a>(int pos, Button button = Button_None);</td></tr>
				<tr><td align="right">bool </td><td><a href="#insertTitleButton(int, BButton*)">insertTitleButton</a>(int pos, BButton* button);</td></tr>
				<tr><td align="right">bool </td><td><a href="#removeTitleButton(Button)">removeTitleButton</a>(Button button);</td></tr>
				<tr><td align="right">bool </td><td><a href="#removeTitleButton(BButton*)">removeTitleButton</a>(BButton* button);</td></tr>
				<tr><td align="right">void </td><td><a href="#clearTitleButtons()">clearTitleButtons</a>();</td></tr>
				<tr><td align="right">int </td><td><a href="#titleButtonCount()">titleButtonCount</a>() const;</td></tr>
				<tr><td align="right">const BButton* </td><td><a href="#titleButton(int)">titleButton</a>(int index) const;</td></tr>
				<tr><td align="right">bool </td><td><a href="#show(ShowState)">show</a>(ShowState state = Show_None);</td></tr>
				<tr><td align="right">ShowState </td><td><a href="#showState()">showState</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#close()">close</a>();</td></tr>
				<tr><td align="right">virtual bool </td><td><a href="#input(const BString&, const BValue&)">input</a>(const BString& text, const BValue& value);</td></tr>
				<tr><td align="right">using </td><td><a href="#BObject::query;()">BObject::query;</a></td></tr>
				<tr><td align="right">virtual bool </td><td><a href="#query(const BString&, BValue&)">query</a>(const BString& text, BValue& value) const;</td></tr>
			</table>
			<h2>protected</h2>
			<table id="protected">
				<tr><td align="right">virtual void </td><td><a href="#event(const BEvent&)">event</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#showEvent(const BEvent&)">showEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#closeEvent(const BEvent&)">closeEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#activeEvent(const BEvent&)">activeEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#resizeEvent(const BEvent&)">resizeEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#styleEvent(const BEvent&)">styleEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#freshEvent(const BEvent&)">freshEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#paintEvent(const BEvent&)">paintEvent</a>(const BEvent& event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseEnterEvent(const BMouseEvent&)">mouseEnterEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseLeaveEvent(const BMouseEvent&)">mouseLeaveEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mousePressEvent(const BMouseEvent&)">mousePressEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseReleaseEvent(const BMouseEvent&)">mouseReleaseEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseMoveEvent(const BMouseEvent&)">mouseMoveEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseWheelEvent(const BMouseEvent&)">mouseWheelEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseDoubleClickEvent(const BMouseEvent&)">mouseDoubleClickEvent</a>(const BMouseEvent& mouseEvent);</td></tr>
			</table>
			<div id="desc">
				<h2>详细介绍：</h2>
				<p>BMainWindow是显示标题的主窗口控件，其会在初始显示时以合适的大小显示于屏幕中央。默认大小是屏幕大量小的76%。此控件与对话框控件不同，没有独立运行机制，且关闭信号也没有值。</p><p>主窗口在创建时会的拥有三个按钮：最小化，最大化，关闭。</p><h4>信号表：</h4><table>
					<tr><td>Signal_Close</td><td>关闭对话框时发出，值为const BValue&amp; value。</td></tr></table>
			</div>
			<h2 id="docs">成员文档：</h2>
			<div id="BMainWindow(BWidget*)">
				<h3>BMainWindow(BWidget* parent = 0);</h3>
				<p>构造一个主窗口对象，parent指定其父控件。</p>
			</div>
			<div id="BMainWindow(const BString&,BWidget*)">
				<h3>BMainWindow(const BString&amp; title, BWidget* parent = 0);</h3>
				<p>构造一个主窗口对象，title设置其标题文本，parent指定其父控件。</p>
			</div>
			<div id="~BMainWindow()">
				<h3>~BMainWindow();</h3>
				<p>析构一个主窗口。此方法会断开与按钮的信号连接。</p>
			</div>
			<div id="setTitle(const BString&)">
				<h3>virtual bool setTitle(const BString&amp; title);</h3>
				<p>重写标题设置方法，若标题改变了，则刷新此窗口。</p>
			</div>
			<div id="setIcon(BIcon*)">
				<h3>virtual bool setIcon(BIcon* icon);</h3>
				<p>重写图标设置方法，若图标改变了，则刷新此窗口。</p>
			</div>
			<div id="setFrameless(bool)">
				<h3>virtual void setFrameless(bool frameless);</h3>
				<p>重写修改是否有框架的方法，若改变了则刷新此窗口。</p>
			</div>
			<div id="setTitleVisible(bool)">
				<h3>void setTitleVisible(bool titleVisible);</h3>
				<p>设置此窗口的标题是否显示。</p>
			</div>
			<div id="titleVisible()">
				<h3>bool titleVisible() const;</h3>
				<p>获得当前标题是否显示。</p>
			</div>
			<div id="setTitleAlign(Align)">
				<h3>void setTitleAlign(Align titleAlign);</h3>
				<p>设置标题显示的对齐方式。</p>
			</div>
			<div id="titleAlign()">
				<h3>Align titleAlign() const;</h3>
				<p>获得标题显示的对齐方式。</p>
			</div>
			<div id="setTitleForm(Form)">
				<h3>void setTitleForm(Form titleForm);</h3>
				<p>设置标题的显示形式。</p>
			</div>
			<div id="titleForm()">
				<h3>Form titleForm() const;</h3>
				<p>获得此窗口的标题显示形式。</p>
			</div>
			<div id="addTitleButton(Button)">
				<h3>BButton* addTitleButton(Button button = Button_None);</h3>
				<p>添加一个新按钮到最后面位置，新按钮的资产值为button。</p>
			</div>
			<div id="addTitleButton(BButton*)">
				<h3>bool addTitleButton(BButton* button);</h3>
				<p>添加一个按钮到最后面位置。</p>
			</div>
			<div id="insertTitleButton(int,Button)">
				<h3>BButton* insertTitleButton(int pos, Button button = Button_None);</h3>
				<p>插入一个新的按钮到pos位置，新按钮的值为button。返回新的按钮。</p>
			</div>
			<div id="insertTitleButton(int, BButton*)">
				<h3>bool insertTitleButton(int pos, BButton* button);</h3>
				<p>插入一个标题按钮到pos位置。</p>
			</div>
			<div id="removeTitleButton(Button)">
				<h3>bool removeTitleButton(Button button);</h3>
				<p>移除资产值等于button的标题按钮。</p>
			</div>
			<div id="removeTitleButton(BButton*)">
				<h3>bool removeTitleButton(BButton* button);</h3>
				<p>移除指定的标题按钮。</p>
			</div>
			<div id="clearTitleButtons()">
				<h3>void clearTitleButtons();</h3>
				<p>清空所有标题按钮。</p>
			</div>
			<div id="titleButtonCount()">
				<h3>int titleButtonCount() const;</h3>
				<p>获得标题按钮的个数。</p>
			</div>
			<div id="titleButton(int)">
				<h3>const BButton* titleButton(int index) const;</h3>
				<p>获得第index个标题按钮。</p>
			</div>
			<div id="show(ShowState)">
				<h3>bool show(ShowState state = Show_None);</h3>
				<p>使用此窗口以某种形态显示。当显示状态值为最小化时，就不显示了。</p>
			</div>
			<div id="showState()">
				<h3>ShowState showState() const;</h3>
				<p>获取当前窗口的显示状态。</p>
			</div>
			<div id="close()">
				<h3>void close();</h3>
				<p>生成并处理关闭事件，默认情况下对关闭事件的处理是结束程序。</p>
			</div>
			<div id="input(const BString&, const BValue&)">
				<h3>virtual bool input(const BString&amp; text, const BValue&amp; value);</h3>
				<p>输入表如下：</p><table>
					<tr><td>centering</td><td>设置自动居中是否开启，值为bool centering。</td></tr>
					<tr><td>adapting</td><td>设置自适应尺寸是否开启，值为bool adapting。</td></tr></table>
			</div>
			<div id="BObject::query;()">
				<h3>using BObject::query;</h3>
			</div>
			<div id="query(const BString&, BValue&)">
				<h3>virtual bool query(const BString&amp; text, BValue&amp; value) const;</h3>
				<p>查询表如下：</p><table>
					<tr><td>text-rect</td><td>取得标题文本的绘制矩形，值为BRect textRect。</td></tr>
					<tr><td>text-area</td><td>取得标题文本的布局区域，值为BRect textArea。</td></tr>
					<tr><td>icon-rect</td><td>取得标题图标的绘制矩形，值为BRect iconRect。</td></tr>
					<tr><td>icon-area</td><td>取得标题图标的布局区域，值为BRect iconArea。</td></tr>
					<tr><td>centering</td><td>取得当前自动中心调整是否开启，值为bool centering。</td></tr>
					<tr><td>adapting</td><td>取得当前尺寸自动调整是否开启，值为bool adaping。</td></tr></table>
			</div>
			<div id="event(const BEvent&)">
				<h3>virtual void event(const BEvent&amp; event);</h3>
				<p>当发生移动事件时，取消之后的自动居中调整。</p>
			</div>
			<div id="showEvent(const BEvent&)">
				<h3>virtual void showEvent(const BEvent&amp; event);</h3>
				<p>显示事件发生时，如果需要则进行位置居中处理，以及尺寸调整。</p>
			</div>
			<div id="closeEvent(const BEvent&)">
				<h3>virtual void closeEvent(const BEvent&amp; event);</h3>
				<p>发出信号：Signal_Close，无值。</p>
			</div>
			<div id="activeEvent(const BEvent&)">
				<h3>virtual void activeEvent(const BEvent&amp; event);</h3>
				<p>当此窗口成为活跃状态时，若窗口处于最小化，则窗口会恢复最大化或常规。</p>
			</div>
			<div id="resizeEvent(const BEvent&)">
				<h3>virtual void resizeEvent(const BEvent&amp; event);</h3>
				<p>尺寸变化时更新标题和各个按钮的显示布局。</p>
			</div>
			<div id="styleEvent(const BEvent&)">
				<h3>virtual void styleEvent(const BEvent&amp; event);</h3>
				<p>样式表取值：</p><table>
					<tr><td>Value_Icon_Size</td><td>取值为标题图标大小，值为BSize iconSize。</td></tr>
					<tr><td>Value_Align</td><td>取值为标题的对齐方式，值为Align titleAlign。</td></tr>
					<tr><td>Value_Spacing</td><td>取值为标题中图标与文本的间隔，值为int spacing。</td></tr>
					<tr><td>Value_Title_Visible</td><td>取值为标题是否显示，值为bool titleVisible。</td></tr></table><p>子样式取值："title"</p><table>
					<tr><td>Value_Height</td><td>取值为标题高度，值为int titleHeight。</td></tr>
					<tr><td>Value_Align</td><td>取值为标题的对齐方式，值为Align titleAlign。</td></tr>
					<tr><td>Value_Spacing</td><td>取值为标题中图标与文本的间， 值为int spacing。</td></tr>
					<tr><td>Value_Icon_Size</td><td>取值为标题中图标的大小，值BSize iconSize。</td></tr>
					<tr><td>Value_Margin_Left</td><td>取值为标题内容的左边距，值为int left。</td></tr>
					<tr><td>Value_Margin_Top</td><td>取值为标题内容的顶边距，值为int top。</td></tr>
					<tr><td>Value_Margin_Right</td><td>取值为标题内容的右边距，值为int right。</td></tr>
					<tr><td>Value_Margin_Bottom</td><td>取值为标题内容的底边距，值为int bottom。</td></tr></table>
			</div>
			<div id="freshEvent(const BEvent&)">
				<h3>virtual void freshEvent(const BEvent&amp; event);</h3>
				<p>重新调整标题绘制和各个按钮的布局。</p>
			</div>
			<div id="paintEvent(const BEvent&)">
				<h3>virtual void paintEvent(const BEvent&amp; event);</h3>
				<p>绘制标题时，使用title子样式作为本地样式。</p>
			</div>
			<div id="mouseEnterEvent(const BMouseEvent&)">
				<h3>virtual void mouseEnterEvent(const BMouseEvent&amp; mouseEvent);</h3>
			</div>
			<div id="mouseLeaveEvent(const BMouseEvent&)">
				<h3>virtual void mouseLeaveEvent(const BMouseEvent&amp; mouseEvent);</h3>
			</div>
			<div id="mousePressEvent(const BMouseEvent&)">
				<h3>virtual void mousePressEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>标记鼠标左键按下的状态。</p>
			</div>
			<div id="mouseReleaseEvent(const BMouseEvent&)">
				<h3>virtual void mouseReleaseEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>取消鼠标左键按下的状态。</p>
			</div>
			<div id="mouseMoveEvent(const BMouseEvent&)">
				<h3>virtual void mouseMoveEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>刷新鼠标位置的尺寸调整模式。</p>
			</div>
			<div id="mouseWheelEvent(const BMouseEvent&)">
				<h3>virtual void mouseWheelEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>过滤滚轮操作，使之不再向父控件传递。</p>
			</div>
			<div id="mouseDoubleClickEvent(const BMouseEvent&)">
				<h3>virtual void mouseDoubleClickEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>处理双击标题的事件，会使用窗口最大化或常规大小显示。</p>
			</div>
		</div>
	</body>
</html>